In many signal processing applications there is a need to perform more or less complex calculations on values representing the amplitude and phase of the signals that are involved. Needless to say, such calculations are typically very difficult to perform unless the signals are represented by sequences of digital values obtained by sampling procedures in, e.g., an analog-to-digital (A/D) converter.
Typically, an A/D converter provides a sequence of samples at one specific rate, i.e. at a sampling rate. Typically, the rate at which the analog signal is sampled is a predetermined setting of the A/D converter. However, in many situations it is desirable to obtain more than one representation of an analog signal, each at a different sampling rate. This can be done by applying several A/D converters in parallel on the analog signal. However, this is not very flexible, nor is it efficient in terms of use of calculation resources. It is hence desirable to provide a way in which an already sampled signal can be re-sampled at a different rate than an original sampling rate.
An ideal approach to re-sample an already sampled analog signal, at a new sampling rate different to the sampling rate used during the original sampling of the signal, is to reconstruct the analog signal from the original signal samples and re-sample it with the desired output rate to obtain new output samples. If samples at x(nTs) of an input signal x(t) sampled at a rate of Fs, n being integer values, assuming that x(t) is band limited to Fs/2, then by Shannon's sampling theorem x(t) can be uniquely reconstructed from the samples x(nTs) using:
                                                        x              ^                        ⁡                          (              t              )                                =                                                    ∑                                  n                  =                                      -                    ∞                                                  ∞                            ⁢                                                          ⁢                                                x                  ⁡                                      (                                          nT                      s                                        )                                                  ⁢                                                      h                    s                                    ⁡                                      (                                          t                      -                                              nT                        s                                                              )                                                                        ≡                          x              ⁡                              (                t                )                                                    ⁢                                  ⁢        where                            (        1        )                                                      h            s                    ⁡                      (            t            )                          =                              sinc            ⁡                          (                                                F                  s                                ⁢                t                            )                                =                                    sin              ⁡                              (                                  π                  ⁢                                                                          ⁢                                      F                    s                                    ⁢                  t                                )                                                    π              ⁢                                                          ⁢                              F                s                            ⁢              t                                                          (        2        )            
Equation 1 and equation 2 show that, for an ideal reconstruction of the digital samples, a filter with an impulse response same as that of a sampled sinc function is needed. Hence the analog signal can be reconstructed using the equations as follows:
                              x          ⁡                      (            t            )                          =                              ∑                          n              =                              -                ∞                                      ∞                    ⁢                                          ⁢                                    x              ⁡                              (                                  nT                  s                                )                                      ⁢                          sinc              ⁡                              (                                  t                  -                                      nT                    s                                                  )                                                                        (        3        )            
Ts is the input signal sampling period, i.e. the original sampling period. x(nTs) are the samples and x(t) is the ideal reconstructed analog signal. Normalizing the input sampling period Ts to “1”, equation 3 reduces to
                              x          ⁡                      (            t            )                          =                              ∑                          n              =                              -                ∞                                      ∞                    ⁢                                          ⁢                                    x              ⁡                              (                n                )                                      ⁢                          sinc              ⁡                              (                                  t                  -                  n                                )                                                                        (        4        )            
In order to calculate the exact analog output at any given time u, all that is needed is to substitute the value of u in place of t in equation 4. Therefore the value at any instant of time on the wave can be calculated using:
                              x          ⁡                      (            u            )                          =                              ∑                          n              =                              -                ∞                                      ∞                    ⁢                                          ⁢                                    x              ⁡                              (                n                )                                      ⁢                          sinc              ⁡                              (                                  u                  -                  n                                )                                                                        (        5        )            
This method of sinc convolution gives an ideal result, i.e. the samples that would be obtained if an analog reconstruction filter and a re-sampler at the desired output rate were used. The real problem with this method lies in the fact that an infinite number of samples are needed, as shown in the above equations. To overcome this problem, a windowed sinc function instead of using just a pure sinc function can be used. A Kaiser window with a particular value of beta (a parameter that characterizes the shape of the Kaiser window) typically gives good results.
One method for fractional sampling rate conversion is the Farrow filter, the basic structure of which is shown in FIG. 6. FIG. 6 illustrates a Farrow filter with a filter length of 4 and order of 3. The ugen unit is responsible for generating a variable delay (time units) between the desired sample and the input sample on the time scale. The polynomials described by the Farrow filter to calculate the output correspond to the polynomials that describe the different lobes of a sinc function. This relation is depicted in FIG. 6 where a sinc function with four lobes is shown with each lobe mapping to a respective arm of the Farrow filter. The coefficients of the polynomial used to approximate the lobes are mapped to the respective filter arm encircled using dashed lines. The un-filled points represent the input samples and the black point represents the output which is to be calculated. Since the output required is at a distance u from one of the input samples, the sum of weighted values of the four input samples is needed to represent the desired output correctly.
Using longer filters, i.e. using more lobes of the sinc function, results in better approximation of the samples as does using a higher order polynomial to approximate the sinc lobes. As discussed above, a Kaiser window can be used to mitigate the effects of finite length sinc function. The precise calculation of the fractional distance u between the desired output and one of the input samples is of utmost importance and the full multipliers used to compute the final result should be able to maintain the desired level of accuracy needed. The constant multipliers and adder widths can be adjusted depending upon the performance requirements.
The distance u may be calculated according to the following simple algorithm:
u = OSR; //Initialization of u - only done onceif(u<=0.5){  u = u + OSR;}else{ u = u − 1;}where OSR is the over sampling ratio defined as the desired output sampling rate divided by the sample rate of the input samples Ts.